import { request } from "@/utils"

// 获取频道列表
export function getChannelsApi() {
  return request ({
    url:'/channels',
    method:'GET',
  })
}
// 提交表单数据
export function createArticleApi (data) {
  return request ({
    url:'/mp/articles?draft=false',
    method:'POST',
    data
  })
}
// 获取文章列表
export function getArticleListApi (params) {
  return request ({
    url:'/mp/articles',
    method:'GET',
    params
  })
}
// 删除文章
export function delArticleListApi (id) {
  return request ({
    url:`/mp/articles/${id}`,
    method:'DELETE'
  })
}
// 回显表单数据
export function getListApi (id) {
  return request ({
    url:`/mp/articles/${id}`,
    method:'GET'
  })
}
// 更新文章
export function newArticleApi (data) {
  return request ({
    url:`/mp/articles/${data.id}?draft=false`,
    method:'PUT',
    data
  })
}